import axios from "axios";

export const getListApi = (params) =>
  axios.get("http://localhost:3001/data", { params });

export const addListApi = (data) =>
  axios.post("http://localhost:3001/data", data);

export const editListApi = (id) =>
  axios.get(`http://localhost:3001/data/${id}`);

export const updateListApi = (data) =>
  axios.put(`http://localhost:3001/data/${data.id}`, data);

export const delListApi = (id) =>
  axios.delete(`http://localhost:3001/data/${id}`);

export const searchApi = (data) =>
  axios.get(`http://localhost:3001/data/?name=${data}`);
